package es.udc.pfc.davidparedes.web.pages.user;

import java.util.List;

import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.ioc.annotations.Inject;


import es.udc.pfc.davidparedes.model.director.Director;
import es.udc.pfc.davidparedes.model.storeservice.StoreDirectorsDTO;
import es.udc.pfc.davidparedes.model.storeservice.StoreService;
import es.udc.pfc.davidparedes.web.services.AuthenticationPolicy;
import es.udc.pfc.davidparedes.web.services.AuthenticationPolicyType;
import es.udc.pfc.davidparedes.web.util.UserSession;

@AuthenticationPolicy(AuthenticationPolicyType.ADMIN)
public class AdminStores {
	
	@Property
	private List<StoreDirectorsDTO> stores;
	
	@Property
	private StoreDirectorsDTO store;
	
	@Property
	private Director director;
    
    @SessionState(create=false)
    private UserSession userSession;
    
    @Inject
    private StoreService storeService;
    
    void onActivate() {
    	stores = storeService.getAllStoresAndDirectors();
    }
    
}
